<template>
  <a-modal
    :title="title"
    :width="1000"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    :class="editType =='detail'?'pic-preview':''"
    :cancelText="editType =='detail'?'关闭':'取消'">
    
    <a-spin :spinning="confirmLoading">
      <a-form :form="form" class="personInfo">
        <a-row>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="账户名">
              {{model.UserName}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="昵称">
              {{model.Nickname}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="公司">
              {{model.Company_CompanyName}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="手机号">
              {{model.Phone}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="邮箱">
              {{model.Email}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="性别">
              {{model.Gender_Value}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="所在地">
              {{model.Province_RegionName?model.Province_RegionName:''+' - '+model.City_RegionName?model.City_RegionName:''+' - '+model.District_RegionName?model.District_RegionName:''}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="所处行业">
              {{model.Industry_Industry}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="职务">
              {{model.Job}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="是否服务商">
              {{model.IsSupplier == '1' ? '是' : model.IsSupplier == '0' ? '否' : ''}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="创建时间">
              {{model.Ts ? new Date(parseInt(model.Ts)).toLocaleDateString().replace('/','-').replace('/','-'):''}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="服务开始日">
              {{model.SupplyBeginDate}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="服务结束日">
              {{model.SupplyEndDate}}
            </a-form-item>
          </a-col>
          <!-- <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="名片访问量">
              {{model.BrowseNum}}
            </a-form-item>
          </a-col> -->
          <!-- <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="微信号">
              {{model.Wechat}}
            </a-form-item>
          </a-col> -->
          <!-- <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="会员等级">
              {{model.MemberLevel_MemberLevelName}}
            </a-form-item>
          </a-col> -->
          <!-- <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="当前积分">
              {{model.IntegralValue}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="令余额">
              {{model.Lin}}
            </a-form-item>
          </a-col> -->
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="职业认证">
              {{model.IdentificationStatus_Value}}
            </a-form-item>
          </a-col>
          <!-- <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="账户名">
              {{model.IdentificationStatus_Value}}
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="账户名">
              {{model.UserName}}
            </a-form-item>
          </a-col> -->
        </a-row>
      
		    
      </a-form>
      <a-tabs>
        <a-tab-pane key="1" tab="令账单">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns1"
            :dataSource="dataSource1"
            :pagination="ipagination1"
            class="j-table-force-nowrap"
            @change="handleTableChange1">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="2" tab="积分明细">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns2"
            :dataSource="dataSource2"
            :pagination="ipagination2"
            class="j-table-force-nowrap"
            @change="handleTableChange2">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="3" tab="券明细">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns3"
            :dataSource="dataSource3"
            :pagination="ipagination3"
            class="j-table-force-nowrap"
            @change="handleTableChange3">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="4" tab="发布需求">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns4"
            :dataSource="dataSource4"
            :pagination="ipagination4"
            class="j-table-force-nowrap"
            :customRow="customRowFunc4"
            @change="handleTableChange4">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="5" tab="获取商机">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns5"
            :dataSource="dataSource5"
            :pagination="ipagination5"
            :customRow="customRowFunc5"
            class="j-table-force-nowrap"
            @change="handleTableChange5">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="6" tab="换物信息">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns6"
            :dataSource="dataSource6"
            :pagination="ipagination6"
            class="j-table-force-nowrap"
            @change="handleTableChange6">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="7" tab="活动报名">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns7"
            :dataSource="dataSource7"
            :pagination="ipagination7"
            class="j-table-force-nowrap"
            @change="handleTableChange7">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="8" tab="服务商申请记录">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns8"
            :dataSource="dataSource8"
            :pagination="ipagination8"
            class="j-table-force-nowrap"
            @change="handleTableChange8">
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="9" tab="访问记录">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns9"
            :dataSource="dataSource9"
            :pagination="ipagination9"
            class="j-table-force-nowrap"
            @change="handleTableChange9">
          </a-table>
        </a-tab-pane>
      </a-tabs>
    </a-spin>
    <businesstrademodal ref="modalForm4"></businesstrademodal>
    <companyInteractive-modal ref="modalForm5"></companyInteractive-modal>
  </a-modal>
</template>

<script>
  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import moment from "moment"
  import businesstrademodal from './BusinessTradeModal'
  import CompanyInteractiveModal from './CompanyInteractiveModal'
  export default {
    name: "CompanyInfoModal",
    components: {
        businesstrademodal,CompanyInteractiveModal
    },
    watch:{
      visible(newVal,oldVal){
        if(newVal){
          this.editType = sessionStorage.getItem('editType');
        }
      }
    },
    data () {
      return {
        columns1:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '异动来源',
            align:"center",
            dataIndex: 'LinSourceType_Value'
           },{
            title: '描述',
            align:"center",
            dataIndex: 'Remarks'
           },{
            title: '异动类型',
            align:"center",
            dataIndex: 'IntegralType_Value'
           },{
            title: '异动值',
            align:"center",
            dataIndex: 'IntegralValue'
           },{
            title: '异动时间',
            align:"center",
            dataIndex: 'IntegralTime'
           }],
        dataSource1:[],
        ipagination1:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns2:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '异动来源',
            align:"center",
            dataIndex: 'SourceType_Value'
           },{
            title: '描述',
            align:"center",
            dataIndex: 'Remarks'
           },{
            title: '异动类型',
            align:"center",
            dataIndex: 'IntegralType_Value'
           },{
            title: '异动值',
            align:"center",
            dataIndex: 'IntegralValue'
           },{
            title: '异动时间',
            align:"center",
            dataIndex: 'IntegralTime'
           }],
        dataSource2:[],
        ipagination2:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns3:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '获取来源',
            align:"center",
            dataIndex: 'CouponSourceType_Value'
           },{
            title: '描述',
            align:"center",
            dataIndex: 'Remarks'
           },{
            title: '额度',
            align:"center",
            dataIndex: 'CouponsLin'
           },{
            title: '有效期',
            align:"center",
            dataIndex: 'ValidDate'
           },{
            title: '获取时间',
            align:"center",
            dataIndex: 'UsedTime'
           },{
            title: '核销来源',
            align:"center",
            dataIndex: 'CouponUsedType_Value'
           },{
            title: '核销描述',
            align:"center",
            dataIndex: 'UsedRemarks'
           },{
            title: '状态',
            align:"center",
            dataIndex: 'CouponStatus_Value'
           }],
        dataSource3:[],
        ipagination3:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns4:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '需求单号',
            align:"center",
            dataIndex: 'InteractiveNo'
           },
          {
            title: '需求类型',
            align:"center",
            dataIndex: 'DemandTag'
           },
          {
            title: '需求标题',
            align:"center",
            dataIndex: 'InteractiveTheme'
           },
          {
            title: '发布时间',
            align:"center",
            dataIndex: 'InteractiveDate'
           },
          {
            title: '状态',
            align:"center",
            dataIndex: 'ApproveStatus_Value'
           }],
        dataSource4:[],
        ipagination4:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns5:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '商机单号',
            align:"center",
            dataIndex: 'Interactive_InteractiveNo'
           },
          {
            title: '商机类型',
            align:"center",
            dataIndex: 'Interactive_InteractiveType_Value'
           },
          {
            title: '商机标题',
            align:"center",
            dataIndex: 'Interactive_InteractiveTheme'
           },
          {
            title: '获取时间',
            align:"center",
            dataIndex: 'TradeDate'
           },
          {
            title: '状态',
            align:"center",
            dataIndex: 'Interactive_ApproveStatus_Value'
           }],
        dataSource5:[],
        ipagination5:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns6:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '物品名称',
            align:"center",
            dataIndex: 'ItemName'
           },
          {
            title: '币种',
            align:"center",
            dataIndex: 'ItemType_Value'
           },
          {
            title: '消费额度',
            align:"center",
            dataIndex: 'IntegralValue'
           },
           {
            title: '换物时间',
            align:"center",
            dataIndex: 'CreateDate'
           },{
            title: '状态',
            align:"center",
            dataIndex: 'ExchangeStatus_Value'
           }],
        dataSource6:[],
        ipagination6:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns7:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },{
            title: '活动类型',
            align:"center",
            dataIndex: 'EventType'
           },{
            title: '活动名称',
            align:"center",
            dataIndex: 'EventTitle'
           },{
            title: '活动时间',
            align:"center",
            dataIndex: 'EventDate'
           },{
            title: '报名时间',
            align:"center",
            dataIndex: 'IntegralTime'
           }
          ],
        dataSource7:[],
        ipagination7:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns8:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },{
            title: '申请类型',
            align:"center",
            dataIndex: 'ApplyType_Value'
           },{
            title: '支付金额',
            align:"center",
            dataIndex: 'PayAMT'
           },{
            title: '支付时间',
            align:"center",
            dataIndex: 'PayDate'
           }
          ],
        dataSource8:[],
        ipagination8:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        columns9:[{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },{
            title: '访问人微信',
            align:"center",
            dataIndex: 'UserInfo_Wechat'
           },{
            title: '访问人姓名',
            align:"center",
            dataIndex: 'UserInfo_PersonalInfo_PersonalName'
           },{
            title: '访问人手机',
            align:"center",
            dataIndex: 'UserInfo_Phone'
           },{
            title: '职务',
            align:"center",
            dataIndex: 'UserInfo_PositionTag'
           },{
            title: '公司',
            align:"center",
            dataIndex: 'UserInfo_Company_CompanyName'
           },{
            title: '访问时间',
            align:"center",
            dataIndex: 'OpedUser_Ts',
            customRender:function (t,r,index) {
              return t?new Date(parseInt(t)).toLocaleDateString().replace('/','-').replace('/','-'):'';
            }
           }
          ],
        dataSource9:[],
        ipagination9:{
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
                return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
        },
        districtOfficeArr:[],
        currentTypeData:[],
        secondParkArr:[],
        secondIndustryData:[],
        editType:'',
        industryData:[],
        industryTagData:[],
        opeStatusData:[{
          id:'5',
          name:'存续'
        },{
          id:'6',
          name:'在业'
        },{
          id:'7',
          name:'吊销'
        },{
          id:'9',
          name:'迁入'
        },{
          id:'10',
          name:'存续'
        },{
          id:'11',
          name:'迁出'
        },{
          id:'12',
          name:'停业'
        },{
          id:'13',
          name:'清算'
        }],
        title:"操作",
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 },
        },
        confirmLoading: false,
        form: this.$form.createForm(this),
        validatorRules:{
        companyid:{rules: [{ required: true, message: '请输入公司ID!' }]},
        companycode:{rules: [{ required: true, message: '请输入统一信用代码!' }]},
        companyname:{rules: [{ required: true, message: '请输入公司全称!' }]},
        companyabbr:{rules: [{ required: true, message: '请输入公司简称!' }]},
        companybrief:{rules: [{ required: true, message: '请输入一句话简介!' }]},
        legalperson:{rules: [{ required: true, message: '请输入法人!' }]},
        registeredamt:{rules: [{ required: true, message: '请输入注册资本!' }]},
        paidinamt:{rules: [{ required: true, message: '请输入实缴资本!' }]},
        businessscope:{rules: [{ required: true, message: '请输入经营范围!' }]},
        registereddate:{rules: [{ required: true, message: '请输入成立日期!' }]},
        highteckparkid:{rules: [{ required: true, message: '请输入所属园区!' }]},
        cityid:{rules: [{ required: true, message: '请输入所在城市!' }]},
        registereddistrictid:{rules: [{ required: true, message: '请输入注册区/县!' }]},
        registeredaddress:{rules: [{ required: true, message: '请输入注册详细地址!' }]},
        officedistrictid:{rules: [{ required: true, message: '请输入办公区/县!' }]},
        officeaddress:{rules: [{ required: true, message: '请输入办公详细地址!' }]},
        isregoffsame:{rules: [{ required: true, message: '请输入办公与注册是否一致!' }]},
        operationstatusid:{rules: [{ required: true, message: '请输入经营状态!' }]},
        industryid:{rules: [{ required: true, message: '请输入所属行业!' }]},
        industrytagid:{rules: [{ required: true, message: '请输入行业标签!' }]},
        ishigtech:{rules: [{ required: true, message: '请输入是否高新企业!' }]},
        isbp:{rules: [{ required: true, message: '请输入是否有BP!' }]},
        teamtag:{rules: [{ required: true, message: '请输入团队标签!' }]},
        teamremark:{rules: [{ required: true, message: '请输入团队描述!' }]},
        staffsizeid:{rules: [{ required: true, message: '请输入人员规模!' }]},
        taxedsizeid:{rules: [{ required: true, message: '请输入纳税规模!' }]},
        valuationsizeid:{rules: [{ required: true, message: '请输入估值规模!' }]},
        refinanceroundid:{rules: [{ required: true, message: '请输入融资轮次!' }]},
        interactivecycleid:{rules: [{ required: true, message: '请输入互动周期!' }]},
        servicestatusid:{rules: [{ required: true, message: '请输入服务状态!' }]},
        linkerid:{rules: [{ required: true, message: '请输入Linker!' }]},
        updatebyid:{rules: [{ required: true, message: '请输入最近更新人!' }]},
        ts:{rules: [{ required: true, message: '请输入最近更新日期!' }]},
        datastatus:{rules: [{ required: true, message: '请输入状态!' }]},
        interactivetag:{rules: [{ required: true, message: '请输入互动标签!' }]},
        },
        parkArr:[],
        cityArr:[],
        districtArr:[],
        personData:[],
        url: {
          add: "/companyInfo/add",
          edit: "/companyInfo/update",
          baseList:"/baseInfo/queryRows",
        },
      }
    },
    created () {
      
      // this.getPerson();
      // this.getCity();
      // this.getBaseData();
      // this.getPark();
      // this.getIndustry();
      // this.getIndustryTag();
    },
    methods: {
      customRowFunc4(record,index){
        return {
          on:{
            click:(event)=>{
              this.showDataDetail4(record,'detail')
            }
          }
        }
      },
      customRowFunc5(record,index){
        return {
          on:{
            click:(event)=>{
              this.showDataDetail5(record,'detail')
            }
          }
        }
      },
      showDataDetail4(record,type){
        this.$refs.modalForm4.edit(record);
        this.$refs.modalForm4.title = "编辑";
        if(type == 'detail'){
            sessionStorage.setItem('editType','detail')
            this.$refs.modalForm4.title = "详情";
        }else{
            sessionStorage.setItem('editType','edit')
        }
        this.$refs.modalForm4.disableSubmit = false;
      },
      showDataDetail5(record,type){
        this.$refs.modalForm5.edit(record);
        this.$refs.modalForm5.title = "编辑";
        if(type == 'detail'){
            sessionStorage.setItem('editType','detail')
            this.$refs.modalForm5.title = "详情";
        }else{
            sessionStorage.setItem('editType','edit')
        }
        this.$refs.modalForm5.disableSubmit = false;
      },
      getAllData(){
        this.getData1();
        this.getData2();
        this.getData3();
        this.getData4();
        this.getData5();
        this.getData6();
        this.getData7();
        this.getData8();
        this.getData9();
      },
      getData1(){
        this.$http.postAction('/userLin/queryRows',{pageNo:this.ipagination1.current,pageSize:this.ipagination1.pageSize,selectFields:[],conditions:[{
              "field":"UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource1 = res.data.rows;
              this.ipagination1.total = res.data.totalCount;
            }
          })
      },
      getData2(){
        this.$http.postAction('/userIntegral/queryRows',{pageNo:this.ipagination2.current,pageSize:this.ipagination2.pageSize,selectFields:[],conditions:[{
              "field":"UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource2 = res.data.rows;
              this.ipagination2.total = res.data.totalCount;
            }
          })
      },
      getData3(){
        this.$http.postAction('/userCoupons/queryRows',{pageNo:this.ipagination3.current,pageSize:this.ipagination3.pageSize,selectFields:[],conditions:[{
              "field":"UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource3 = res.data.rows;
              this.ipagination3.total = res.data.totalCount;
            }
          })
      },
      getData4(){
        this.$http.postAction('/companyInteractive/queryRows',{pageNo:this.ipagination4.current,pageSize:this.ipagination4.pageSize,selectFields:[],conditions:[{
              "field":"DemandUser",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource4 = res.data.rows;
              this.ipagination4.total = res.data.totalCount;
            }
          })
      },
      getData5(){
        this.$http.postAction('/businessInteractive/queryRows',{pageNo:this.ipagination5.current,pageSize:this.ipagination5.pageSize,selectFields:[],conditions:[{
              "field":"DemandUser",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource5 = res.data.rows;
              this.ipagination5.total = res.data.totalCount;
            }
          })
      },
      getData6(){
        this.$http.postAction('/userExchange/queryRows',{pageNo:this.ipagination6.current,pageSize:this.ipagination6.pageSize,selectFields:[],conditions:[{
              "field":"UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource6 = res.data.rows;
              this.ipagination6.total = res.data.totalCount;
            }
          })
      },
      getData7(){
        this.$http.postAction('/userEvent/queryRows',{pageNo:this.ipagination7.current,pageSize:this.ipagination7.pageSize,selectFields:[],conditions:[{
              "field":"UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource7 = res.data.rows;
              this.ipagination7.total = res.data.totalCount;
            }
          })
      },
      getData8(){
        this.$http.postAction('/userSupplierApply/queryRows',{pageNo:this.ipagination8.current,pageSize:this.ipagination8.pageSize,selectFields:[],conditions:[{
              "field":"UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource8 = res.data.rows;
              this.ipagination8.total = res.data.totalCount;
            }
          })
      },
      getData9(){
        this.$http.postAction('/userOplog/queryRows',{pageNo:this.ipagination9.current,pageSize:this.ipagination9.pageSize,selectFields:[],conditions:[{
              "field":"OpedUser_UserInfo",
              "operator":"=",
              "value":this.model.UserId
            }]}).then((res)=>{
            if(res.status == 1){
              this.dataSource9 = res.data.rows;
              this.ipagination9.total = res.data.totalCount;
            }
          })
      },
      handleTableChange1(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination1 = pagination;
          this.getData1();
      },
      handleTableChange2(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination2 = pagination;
          this.getData2();
      },
      handleTableChange3(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination3 = pagination;
          this.getData3();
      },
      handleTableChange4(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination4 = pagination;
          this.getData4();
      },
      handleTableChange5(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination5 = pagination;
          this.getData5();
      },
      handleTableChange6(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination6 = pagination;
          this.getData6();
      },
      handleTableChange7(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination7 = pagination;
          this.getData7();
      },
      handleTableChange8(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination8 = pagination;
          this.getData8();
      },
      handleTableChange9(pagination, filters, sorter) {
          //分页、排序、筛选变化时触发
          this.ipagination9 = pagination;
          this.getData9();
      },
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
        );
      },
      getSecondPark(type){
        this.$nextTick(()=>{
          let data = this.form.getFieldsValue();
          if(type !== 'init'){
            this.form.setFieldsValue({
              SubParkId:''
            })
          }
          this.$http.postAction('/baseHighteckPark/queryRows',{pageNo:1,pageSize:9999,selectFields:[],conditions:[{
              "field":"UpPark",
              "operator":"=",
              "value":data.HighteckParkId?data.HighteckParkId:this.model.HighteckPark
            }]}).then((res)=>{
            if(res.status == 1){
              this.secondParkArr = res.data.rows;
            }
          })
        })
      },
      getSecondIndustry(type){
        this.$nextTick(()=>{
          let data = this.form.getFieldsValue();
          if(type !== 'init'){
            this.form.setFieldsValue({
              SubIndustry:[]
            })
          }
          this.$http.postAction('/baseIndustry/queryRows',{pageNo:1,pageSize:9999,selectFields:[],conditions:[{
              "field":"UpIndustry",
              "operator":"=",
              "value":data.IndustryId?data.IndustryId:this.model.Industry
            }]}).then((res)=>{
            if(res.status == 1){
              this.secondIndustryData = res.data.rows;
            }
          })
        })
        
      },
      getBaseData(){
        this.$http.postAction(this.url.baseList,{pageNo:1,pageSize:100,selectFields:[],conditions:[{
              "field":"TypeCode",
              "operator":"=",
              "value":'OperationStatus'
            }]}).then((res)=>{
          if(res.status == 1){
            this.opeStatusData = res.data.rows;
          }
        })
        this.$http.postAction(this.url.baseList,{pageNo:1,pageSize:100,selectFields:[],conditions:[{
              "field":"TypeCode",
              "operator":"=",
              "value":'CurrencyType'
            }]}).then((res)=>{
          if(res.status == 1){
            this.currentTypeData = res.data.rows;
          }
        })
      },
      changeCity(){
        this.getDistrict();
      },
      changeOfficeCity(){
        this.getOfficeDistrict();
      },
      getIndustry(){
        this.$http.postAction('/baseIndustry/queryRows',{pageNo:1,pageSize:9999,selectFields:[],conditions:[{
              "field":"UpIndustry.Industry",
              "operator":"IS NULL",
              "value":""
            }]}).then((res)=>{
          if(res.status == 1){
            this.industryData = res.data.rows;
          }
        })
      },
      getIndustryTag(type){
        this.$nextTick(()=>{
          let data = this.form.getFieldsValue();
          if(type !== 'init'){
            this.form.setFieldsValue({
              IndustryTagId:[]
            })
          }
          this.$http.postAction('/baseIndustryTag/queryRows',{pageNo:1,pageSize:9999}).then((res)=>{
            if(res.status == 1){
              this.industryTagData = res.data.rows;
            }
          })
        })
        
      },
      getPark(){
        this.$http.postAction("/baseHighteckPark/queryRows",{pageIndex:1,pageSize:9999}).then(res=>{
            if(res.status == 1){
              this.parkArr = res.data.rows;
            }
          })
      },
      getCity(){
        this.$http.postAction("/baseRegion/queryRows",{pageIndex:1,pageSize:9999,selectFields:[],conditions:[{
              "field":"RegionType",
              "operator":"=",
              "value":2
            }]}).then(res=>{
            if(res.status == 1){
              this.cityArr = res.data.rows;
              let cityId = '';
            }
          })
      },
      getOfficeDistrict(type){
        this.$nextTick(()=>{
          let data = this.form.getFieldsValue();
          let parentId = data.OfficeCityId;
          if(!parentId){
            return false;
          }
          if(type !== 'init'){
            this.form.setFieldsValue({
              OfficeDistrictId:''
            })
          }
          this.districtOfficeArr = [];
          this.$http.postAction("/baseRegion/queryRows",{pageIndex:1,pageSize:9999,selectFields:[],conditions:[{
                "field":"Parent",
                "operator":"=",
                "value":parentId
              }]}).then(res=>{
              if(res.status == 1){
                this.districtOfficeArr = res.data.rows;
              }
            })
        })
      },
      getDistrict(type){
        this.$nextTick(()=>{
          let data = this.form.getFieldsValue();
          let parentId = data.CityId;
          if(!parentId){
            return false;
          }
          if(type !== 'init'){
            this.form.setFieldsValue({
              RegisteredDistrictId:''
            })
          }
          this.districtArr = [];
          this.$http.postAction("/baseRegion/queryRows",{pageIndex:1,pageSize:9999,selectFields:[],conditions:[{
                "field":"Parent",
                "operator":"=",
                "value":parentId
              }]}).then(res=>{
              if(res.status == 1){
                this.districtArr = res.data.rows;
              }
            })
        })
      },
      getPerson(){
        this.$http.postAction('/personalInfo/queryRows',{pageNo:1,pageSize:9999}).then((res)=>{
          if(res.status == 1){
            this.personData = res.data.rows;
          }
        })
      },
      add () {
        let id = '';
        this.cityArr.forEach((e)=>{
          if(e.RegionName == '上海市'){
            id = e.RegionId
          }
        })
        let OperationStatuId = '';
        this.opeStatusData.forEach((e)=>{
          if(e.Value == '在业'){
            OperationStatuId = e.BaseInfoId
          }
        })
        this.edit({City:id,OperationStatusId:OperationStatuId});

      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        this.getAllData();
        return;
        if(this.model.CompanyId){
          
            this.$http.postAction("/companyInfo/detail/map",this.model.CompanyId,{
            headers: {
              "Content-type": "application/text"
            }
           }).then(res=>{
              if(res.status == 1){
                res.data.CompanyId = this.model.CompanyId;
                this.model = res.data?res.data:{};
                // this.model.IndustryId = this.model.Industry;
                this.model.IndustryTagId = this.model.IndustryTag?this.model.IndustryTag.split(','):[];
                // this.model.OperationStatusId = this.model.OperationStatus;
                // this.model.CityId = this.model.City;
                // this.model.OfficeDistrictId = this.model.OfficeDistrict;
                // this.model.RegisteredDistrictId = this.model.RegisteredDistrict;
                // this.model.HighteckParkId = this.model.HighteckPark;
                // this.model.SubParkId = this.model.SubPark;
                this.model.SubIndustryId = this.model.SubIndustry?this.model.SubIndustry.split(','):[];
                this.model.SubIndustry = [];
                if(this.model.SubIndustries){
                  this.model.SubIndustries.forEach((e)=>{
                    this.model.SubIndustry.push(e.SubIndustryId)
                  })
                }
                // this.model.CurrencyTypeId = this.model.CurrencyType;
              }
              this.$nextTick(() => {
                this.form.setFieldsValue(pick(this.model,'CompanyCode','CompanyName','CompanyAbbr','CompanyBrief','LegalPerson','RegisteredAmt','PaidinAmt','HighteckParkId','CityId','OfficeCityId','RegisteredDistrictId','RegisteredAddress','OfficeDistrictId','OfficeAddress','OperationStatusId','IndustryId','IndustryTagId','TeamRemark','CompanyDepiction','SubIndustry','SubParkId','CurrencyTypeId'))
                this.getDistrict('init');
                this.getOfficeDistrict('init');
                //时间格式化
                this.form.setFieldsValue({RegisteredDate:this.model.RegisteredDate?moment(this.model.RegisteredDate,'YYYY-MM-DD HH:mm:ss'):null})
                })
                this.changePark();
              }); 
              this.getSecondIndustry('init');
              this.getSecondPark('init'); 
              
        }else{
          this.$nextTick(() => {
            this.form.setFieldsValue(pick(this.model,'CompanyCode','CompanyName','CompanyAbbr','CompanyBrief','LegalPerson','RegisteredAmt','PaidinAmt','HighteckParkId','CityId','RegisteredDistrictId','RegisteredAddress','OfficeDistrictId','OfficeAddress','OperationStatusId','IndustryId','IndustryTagId','TeamRemark','CompanyDepiction','SubIndustry','SubParkId','CurrencyTypeId'))
            this.getDistrict('init');
            
            //时间格式化
            this.form.setFieldsValue({RegisteredDate:this.model.RegisteredDate?moment(this.model.RegisteredDate,'YYYY-MM-DD HH:mm:ss'):null})
          });
        }                                        
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      changePark(){
        this.$nextTick(()=>{
          let data = this.form.getFieldsValue();
          let name = '';
          if(data.SubParkId){
            console.log('ffffg',this.parkArr)
            this.parkArr.forEach((e)=>{
              if(e.BaseHighteckParkId == data.SubParkId){
                name = e.ParkType_Value;
              }
            })
          }
          this.form.setFieldsValue({
            ParkTypeName:name,
            SubPark:null
          })
        })
      },
      handleOk () {
        const that = this;
        // 触发表单验证
        this.form.validateFields((err, values) => {
          if (!err) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.CompanyId){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            let formData = Object.assign(this.model, values);
            //时间格式化
            formData.RegisteredDate = formData.RegisteredDate?formData.RegisteredDate.format('YYYY-MM-DD HH:mm:ss'):null;
            formData.IndustryTagId = formData.IndustryTagId instanceof Array?formData.IndustryTagId.join():formData.IndustryTagId;
            formData.SubIndustry = formData.SubIndustry instanceof Array?formData.SubIndustry.join():formData.SubIndustry;
            let arr = [];
            if(formData.SubParkId){
              console.log('ffff',this.parkArr)
              this.parkArr.forEach((e)=>{
                if(e.BaseHighteckParkId == formData.SubParkId){
                  formData.ParkTypeId = e.ParkType;
                }
              })
            }
            if(formData.SubIndustry){
              formData.SubIndustry.split(',').forEach((e)=>{
                arr.push({
                  SubIndustryId:e
                })
              })
            }
            formData.SubIndustries = arr;
            formData.SubPark = null;
            console.log(formData)
            this.$http.postAction(httpurl,formData,method).then((res)=>{
              if(res.status == 1){
                that.$message.success('提交成功');
                if(method == 'post'){
                  this.form.resetFields();
                  this.model = {};
                }else{
                  that.close();
                }
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
              // that.close();
            })



          }
        })
      },
      handleCancel () {
        this.close()
      },


    }
  }
</script>

<style lang="less" scoped>

</style>
<style>
  .labelColMax .ant-form-item-label{
    width: 107px;
    float: left;
  }
  .labelColMax .ant-form-item-control-wrapper{
    width: calc(100% - 120px);
    display: inline-block;
  }
  .labelColMid .ant-form-item-label{
    width: 107px;
    float: left;
  }
  .labelColMid .ant-form-item-control-wrapper{
    width: calc(100% - 120px);
    display: inline-block;
  }
  .personInfo .ant-col-12{
    height: 64px;
  }
</style>